package com.valkyries.jhhj.service.impl;

import com.mybatisflex.core.query.QueryWrapper;
import com.valkyries.jhhj.domain.Permission;
import com.valkyries.jhhj.mapper.PermissionMapper;
import com.valkyries.jhhj.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

import static com.valkyries.jhhj.domain.table.Tables.PERMISSION;

/**
 * 权限Service业务层处理
 */
@Service
public class PermissionServiceImpl implements PermissionService {
    @Autowired
    private PermissionMapper permissionMapper;

    /**
     * 查询列表中包含的所有权限id的数据
     */
    @Override
    public List<Permission> queryListByIds(List<Long> permissionIds) {
        return permissionMapper.selectListByQuery(new QueryWrapper()
                .where(PERMISSION.PERMISSION_ID.in(permissionIds))
        );
    }
}

